package ext.tianma.model;

@SuppressWarnings({"cast", "deprecation", "unchecked"})
public abstract class _APLQuantity extends wt.fc.WTObject implements java.io.Externalizable {
   static final long serialVersionUID = 1;

   static final java.lang.String RESOURCE = "ext.tianma.model.modelResource";
   static final java.lang.String CLASSNAME = APLQuantity.class.getName();

   /**
    * APL材料
    *
    * @see ext.tianma.model.APLQuantity
    */
   public static final java.lang.String PERSISTABLE = "persistable";
   wt.fc.ObjectReference persistable;
   /**
    * APL材料
    *
    * @see ext.tianma.model.APLQuantity
    */
   public wt.fc.ObjectReference getPersistable() {
      return persistable;
   }
   /**
    * APL材料
    *
    * @see ext.tianma.model.APLQuantity
    */
   public void setPersistable(wt.fc.ObjectReference persistable) throws wt.util.WTPropertyVetoException {
      persistableValidate(persistable);
      this.persistable = persistable;
   }
   void persistableValidate(wt.fc.ObjectReference persistable) throws wt.util.WTPropertyVetoException {
   }

   /**
    * 用量
    *
    * @see ext.tianma.model.APLQuantity
    */
   public static final java.lang.String QUANTITY = "quantity";
   static int QUANTITY_UPPER_LIMIT = -1;
   java.lang.String quantity;
   /**
    * 用量
    *
    * @see ext.tianma.model.APLQuantity
    */
   public java.lang.String getQuantity() {
      return quantity;
   }
   /**
    * 用量
    *
    * @see ext.tianma.model.APLQuantity
    */
   public void setQuantity(java.lang.String quantity) throws wt.util.WTPropertyVetoException {
      quantityValidate(quantity);
      this.quantity = quantity;
   }
   void quantityValidate(java.lang.String quantity) throws wt.util.WTPropertyVetoException {
      if (QUANTITY_UPPER_LIMIT < 1) {
         try { QUANTITY_UPPER_LIMIT = (java.lang.Integer) wt.introspection.WTIntrospector.getClassInfo(CLASSNAME).getPropertyDescriptor("quantity").getValue(wt.introspection.WTIntrospector.UPPER_LIMIT); }
         catch (wt.introspection.WTIntrospectionException e) { QUANTITY_UPPER_LIMIT = 10; }
      }
      if (quantity != null && !wt.fc.PersistenceHelper.checkStoredLength(quantity.toString(), QUANTITY_UPPER_LIMIT, true))
         throw new wt.util.WTPropertyVetoException("wt.introspection.introspectionResource", wt.introspection.introspectionResource.UPPER_LIMIT,
               new java.lang.Object[] { new wt.introspection.PropertyDisplayName(CLASSNAME, "quantity"), java.lang.String.valueOf(java.lang.Math.min(QUANTITY_UPPER_LIMIT, wt.fc.PersistenceHelper.DB_MAX_SQL_STRING_SIZE/wt.fc.PersistenceHelper.DB_MAX_BYTES_PER_CHAR)) },
               new java.beans.PropertyChangeEvent(this, "quantity", this.quantity, quantity));
   }

   /**
    * 范围
    *
    * @see ext.tianma.model.APLQuantity
    */
   public static final java.lang.String RANGES = "ranges";
   static int RANGES_UPPER_LIMIT = -1;
   java.lang.String ranges;
   /**
    * 范围
    *
    * @see ext.tianma.model.APLQuantity
    */
   public java.lang.String getRanges() {
      return ranges;
   }
   /**
    * 范围
    *
    * @see ext.tianma.model.APLQuantity
    */
   public void setRanges(java.lang.String ranges) throws wt.util.WTPropertyVetoException {
      rangesValidate(ranges);
      this.ranges = ranges;
   }
   void rangesValidate(java.lang.String ranges) throws wt.util.WTPropertyVetoException {
      if (RANGES_UPPER_LIMIT < 1) {
         try { RANGES_UPPER_LIMIT = (java.lang.Integer) wt.introspection.WTIntrospector.getClassInfo(CLASSNAME).getPropertyDescriptor("ranges").getValue(wt.introspection.WTIntrospector.UPPER_LIMIT); }
         catch (wt.introspection.WTIntrospectionException e) { RANGES_UPPER_LIMIT = 300; }
      }
      if (ranges != null && !wt.fc.PersistenceHelper.checkStoredLength(ranges.toString(), RANGES_UPPER_LIMIT, true))
         throw new wt.util.WTPropertyVetoException("wt.introspection.introspectionResource", wt.introspection.introspectionResource.UPPER_LIMIT,
               new java.lang.Object[] { new wt.introspection.PropertyDisplayName(CLASSNAME, "ranges"), java.lang.String.valueOf(java.lang.Math.min(RANGES_UPPER_LIMIT, wt.fc.PersistenceHelper.DB_MAX_SQL_STRING_SIZE/wt.fc.PersistenceHelper.DB_MAX_BYTES_PER_CHAR)) },
               new java.beans.PropertyChangeEvent(this, "ranges", this.ranges, ranges));
   }

   /**
    * 当前等级
    *
    * @see ext.tianma.model.APLQuantity
    */
   public static final java.lang.String LEVELS = "levels";
   static int LEVELS_UPPER_LIMIT = -1;
   java.lang.String levels;
   /**
    * 当前等级
    *
    * @see ext.tianma.model.APLQuantity
    */
   public java.lang.String getLevels() {
      return levels;
   }
   /**
    * 当前等级
    *
    * @see ext.tianma.model.APLQuantity
    */
   public void setLevels(java.lang.String levels) throws wt.util.WTPropertyVetoException {
      levelsValidate(levels);
      this.levels = levels;
   }
   void levelsValidate(java.lang.String levels) throws wt.util.WTPropertyVetoException {
      if (LEVELS_UPPER_LIMIT < 1) {
         try { LEVELS_UPPER_LIMIT = (java.lang.Integer) wt.introspection.WTIntrospector.getClassInfo(CLASSNAME).getPropertyDescriptor("levels").getValue(wt.introspection.WTIntrospector.UPPER_LIMIT); }
         catch (wt.introspection.WTIntrospectionException e) { LEVELS_UPPER_LIMIT = 100; }
      }
      if (levels != null && !wt.fc.PersistenceHelper.checkStoredLength(levels.toString(), LEVELS_UPPER_LIMIT, true))
         throw new wt.util.WTPropertyVetoException("wt.introspection.introspectionResource", wt.introspection.introspectionResource.UPPER_LIMIT,
               new java.lang.Object[] { new wt.introspection.PropertyDisplayName(CLASSNAME, "levels"), java.lang.String.valueOf(java.lang.Math.min(LEVELS_UPPER_LIMIT, wt.fc.PersistenceHelper.DB_MAX_SQL_STRING_SIZE/wt.fc.PersistenceHelper.DB_MAX_BYTES_PER_CHAR)) },
               new java.beans.PropertyChangeEvent(this, "levels", this.levels, levels));
   }

   /**
    * 等级进阶至
    *
    * @see ext.tianma.model.APLQuantity
    */
   public static final java.lang.String LEVEL_TO = "levelTo";
   static int LEVEL_TO_UPPER_LIMIT = -1;
   java.lang.String levelTo;
   /**
    * 等级进阶至
    *
    * @see ext.tianma.model.APLQuantity
    */
   public java.lang.String getLevelTo() {
      return levelTo;
   }
   /**
    * 等级进阶至
    *
    * @see ext.tianma.model.APLQuantity
    */
   public void setLevelTo(java.lang.String levelTo) throws wt.util.WTPropertyVetoException {
      levelToValidate(levelTo);
      this.levelTo = levelTo;
   }
   void levelToValidate(java.lang.String levelTo) throws wt.util.WTPropertyVetoException {
      if (LEVEL_TO_UPPER_LIMIT < 1) {
         try { LEVEL_TO_UPPER_LIMIT = (java.lang.Integer) wt.introspection.WTIntrospector.getClassInfo(CLASSNAME).getPropertyDescriptor("levelTo").getValue(wt.introspection.WTIntrospector.UPPER_LIMIT); }
         catch (wt.introspection.WTIntrospectionException e) { LEVEL_TO_UPPER_LIMIT = 100; }
      }
      if (levelTo != null && !wt.fc.PersistenceHelper.checkStoredLength(levelTo.toString(), LEVEL_TO_UPPER_LIMIT, true))
         throw new wt.util.WTPropertyVetoException("wt.introspection.introspectionResource", wt.introspection.introspectionResource.UPPER_LIMIT,
               new java.lang.Object[] { new wt.introspection.PropertyDisplayName(CLASSNAME, "levelTo"), java.lang.String.valueOf(java.lang.Math.min(LEVEL_TO_UPPER_LIMIT, wt.fc.PersistenceHelper.DB_MAX_SQL_STRING_SIZE/wt.fc.PersistenceHelper.DB_MAX_BYTES_PER_CHAR)) },
               new java.beans.PropertyChangeEvent(this, "levelTo", this.levelTo, levelTo));
   }

   /**
    * 是否需要进阶
    *
    * @see ext.tianma.model.APLQuantity
    */
   public static final java.lang.String PROMOTION = "promotion";
   java.lang.Boolean promotion;
   /**
    * 是否需要进阶
    *
    * @see ext.tianma.model.APLQuantity
    */
   public java.lang.Boolean getPromotion() {
      return promotion;
   }
   /**
    * 是否需要进阶
    *
    * @see ext.tianma.model.APLQuantity
    */
   public void setPromotion(java.lang.Boolean promotion) throws wt.util.WTPropertyVetoException {
      promotionValidate(promotion);
      this.promotion = promotion;
   }
   void promotionValidate(java.lang.Boolean promotion) throws wt.util.WTPropertyVetoException {
   }

   /**
    * 状况
    *
    * @see ext.tianma.model.APLQuantity
    */
   public static final java.lang.String STATUS = "status";
   static int STATUS_UPPER_LIMIT = -1;
   java.lang.String status;
   /**
    * 状况
    *
    * @see ext.tianma.model.APLQuantity
    */
   public java.lang.String getStatus() {
      return status;
   }
   /**
    * 状况
    *
    * @see ext.tianma.model.APLQuantity
    */
   public void setStatus(java.lang.String status) throws wt.util.WTPropertyVetoException {
      statusValidate(status);
      this.status = status;
   }
   void statusValidate(java.lang.String status) throws wt.util.WTPropertyVetoException {
      if (STATUS_UPPER_LIMIT < 1) {
         try { STATUS_UPPER_LIMIT = (java.lang.Integer) wt.introspection.WTIntrospector.getClassInfo(CLASSNAME).getPropertyDescriptor("status").getValue(wt.introspection.WTIntrospector.UPPER_LIMIT); }
         catch (wt.introspection.WTIntrospectionException e) { STATUS_UPPER_LIMIT = 100; }
      }
      if (status != null && !wt.fc.PersistenceHelper.checkStoredLength(status.toString(), STATUS_UPPER_LIMIT, true))
         throw new wt.util.WTPropertyVetoException("wt.introspection.introspectionResource", wt.introspection.introspectionResource.UPPER_LIMIT,
               new java.lang.Object[] { new wt.introspection.PropertyDisplayName(CLASSNAME, "status"), java.lang.String.valueOf(java.lang.Math.min(STATUS_UPPER_LIMIT, wt.fc.PersistenceHelper.DB_MAX_SQL_STRING_SIZE/wt.fc.PersistenceHelper.DB_MAX_BYTES_PER_CHAR)) },
               new java.beans.PropertyChangeEvent(this, "status", this.status, status));
   }

   /**
    * 是否流程中
    *
    * @see ext.tianma.model.APLQuantity
    */
   public static final java.lang.String PROCESSES = "processes";
   java.lang.Boolean processes;
   /**
    * 是否流程中
    *
    * @see ext.tianma.model.APLQuantity
    */
   public java.lang.Boolean getProcesses() {
      return processes;
   }
   /**
    * 是否流程中
    *
    * @see ext.tianma.model.APLQuantity
    */
   public void setProcesses(java.lang.Boolean processes) throws wt.util.WTPropertyVetoException {
      processesValidate(processes);
      this.processes = processes;
   }
   void processesValidate(java.lang.Boolean processes) throws wt.util.WTPropertyVetoException {
   }

   public java.lang.String getConceptualClassname() {
      return CLASSNAME;
   }

   public wt.introspection.ClassInfo getClassInfo() throws wt.introspection.WTIntrospectionException {
      return wt.introspection.WTIntrospector.getClassInfo(getConceptualClassname());
   }

   public java.lang.String getType() {
      try { return getClassInfo().getDisplayName(); }
      catch (wt.introspection.WTIntrospectionException wte) { return wt.util.WTStringUtilities.tail(getConceptualClassname(), '.'); }
   }

   public static final long EXTERNALIZATION_VERSION_UID = 3756893986826862539L;

   public void writeExternal(java.io.ObjectOutput output) throws java.io.IOException {
      output.writeLong( EXTERNALIZATION_VERSION_UID );

      super.writeExternal( output );

      output.writeObject( levelTo );
      output.writeObject( levels );
      output.writeObject( persistable );
      output.writeObject( processes );
      output.writeObject( promotion );
      output.writeObject( quantity );
      output.writeObject( ranges );
      output.writeObject( status );
   }

   protected void super_writeExternal_APLQuantity(java.io.ObjectOutput output) throws java.io.IOException {
      super.writeExternal(output);
   }

   public void readExternal(java.io.ObjectInput input) throws java.io.IOException, java.lang.ClassNotFoundException {
      long readSerialVersionUID = input.readLong();
      readVersion( (ext.tianma.model.APLQuantity) this, input, readSerialVersionUID, false, false );
   }
   protected void super_readExternal_APLQuantity(java.io.ObjectInput input) throws java.io.IOException, java.lang.ClassNotFoundException {
      super.readExternal(input);
   }

   public void writeExternal(wt.pds.PersistentStoreIfc output) throws java.sql.SQLException, wt.pom.DatastoreException {
      super.writeExternal( output );

      output.setString( "levelTo", levelTo );
      output.setString( "levels", levels );
      output.writeObject( "persistable", persistable, wt.fc.ObjectReference.class, true );
      output.setBooleanObject( "processes", processes );
      output.setBooleanObject( "promotion", promotion );
      output.setString( "quantity", quantity );
      output.setString( "ranges", ranges );
      output.setString( "status", status );
   }

   public void readExternal(wt.pds.PersistentRetrieveIfc input) throws java.sql.SQLException, wt.pom.DatastoreException {
      super.readExternal( input );

      levelTo = input.getString( "levelTo" );
      levels = input.getString( "levels" );
      persistable = (wt.fc.ObjectReference) input.readObject( "persistable", persistable, wt.fc.ObjectReference.class, true );
      processes = input.getBooleanObject( "processes" );
      promotion = input.getBooleanObject( "promotion" );
      quantity = input.getString( "quantity" );
      ranges = input.getString( "ranges" );
      status = input.getString( "status" );
   }

   boolean readVersion3756893986826862539L( java.io.ObjectInput input, long readSerialVersionUID, boolean superDone ) throws java.io.IOException, java.lang.ClassNotFoundException {
      if ( !superDone )
         super.readExternal( input );

      levelTo = (java.lang.String) input.readObject();
      levels = (java.lang.String) input.readObject();
      persistable = (wt.fc.ObjectReference) input.readObject();
      processes = (java.lang.Boolean) input.readObject();
      promotion = (java.lang.Boolean) input.readObject();
      quantity = (java.lang.String) input.readObject();
      ranges = (java.lang.String) input.readObject();
      status = (java.lang.String) input.readObject();
      return true;
   }

   protected boolean readVersion( APLQuantity thisObject, java.io.ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone ) throws java.io.IOException, java.lang.ClassNotFoundException {
      boolean success = true;

      if ( readSerialVersionUID == EXTERNALIZATION_VERSION_UID )
         return readVersion3756893986826862539L( input, readSerialVersionUID, superDone );
      else
         success = readOldVersion( input, readSerialVersionUID, passThrough, superDone );

      if (input instanceof wt.pds.PDSObjectInput)
         wt.fc.EvolvableHelper.requestRewriteOfEvolvedBlobbedObject();

      return success;
   }
   protected boolean super_readVersion_APLQuantity( _APLQuantity thisObject, java.io.ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone ) throws java.io.IOException, java.lang.ClassNotFoundException {
      return super.readVersion(thisObject, input, readSerialVersionUID, passThrough, superDone);
   }

   boolean readOldVersion( java.io.ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone ) throws java.io.IOException, java.lang.ClassNotFoundException {
      throw new java.io.InvalidClassException(CLASSNAME, "Local class not compatible: stream classdesc externalizationVersionUID="+readSerialVersionUID+" local class externalizationVersionUID="+EXTERNALIZATION_VERSION_UID);
   }
}
